<?php

namespace App\Libs\Company\SheetTemplateHandler\Report;

class Template111 extends AbstractTemplate
{
    public $dataStartRow = 3;

    public $rules = [
        'column' => [
            'start_row' => 3,
            'end_row' => ['str' => '合计', 'column' => 0],
            'rule' =>
                [
                    ['column' => 2, 'vt' => 1],
                    ['column' => 3, 'vt' => 2],
                ],
        ],
        'cell' => [
        ],
        'dict' => [
        ],
    ];

    public function generateReport()
    {
        $this->renderHeader();
        $districtName = $this->getDistrictName($this->subTask->district_id);
        $this->output['sheets']['sheet-01']['cellData']['0']['0'] = $this->createTitleCell('日喀则市' . $districtName . "{$this->subTask->task->year}年{$this->subTask->task->key}月\r{$this->template->name}");
        $this->output['sheets']['sheet-01']['cellData'][$this->dataEndRow][0] = ['v' => 1, 's' => 'CENTER'];
        $this->output['sheets']['sheet-01']['cellData'][$this->dataEndRow][1] = ['v' => $districtName, 's' => 'CENTER'];
        $this->output['sheets']['sheet-01']['cellData'][$this->dataEndRow][2] = ['vt' => 1, 't' => 2];
        $this->output['sheets']['sheet-01']['cellData'][$this->dataEndRow][3] = ['vt' => 2, 't' => 2];
        $this->output['sheets']['sheet-01']['rowData'][$this->dataEndRow]['h'] = 40;
        $this->renderFooter();
        return $this->output;
    }
}
